package com.joyd.joydlib.composables

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.joyd.joydlib.ui.theme.JoydLibTheme
import com.joyd.joydlib.composables.JoydButton

/**
 * JoydButton的预览组件
 * 展示了不同状态下的按钮样式
 */
@Preview(
    name = "JoydButton Preview",
    showBackground = true,
    backgroundColor = 0xFFFFFFFF,
    showSystemUi = true
)
@Composable
fun JoydButtonPreview() {
    JoydLibTheme {
        Column(
            modifier = Modifier
                .fillMaxSize()
                .padding(16.dp),
            verticalArrangement = Arrangement.spacedBy(16.dp),
            horizontalAlignment = Alignment.CenterHorizontally
        ) {
            // 默认状态的按钮
            JoydButton(
                text = "Normal Button",
                onClick = { /* 点击事件 */ }
            )

            // 禁用状态的按钮
            JoydButton(
                text = "Disabled Button",
                onClick = { /* 点击事件 */ },
                enabled = false
            )

            // 自定义大小的按钮
            JoydButton(
                text = "Custom Size",
                onClick = { /* 点击事件 */ },
                modifier = Modifier
                    .padding(24.dp)
            )
        }
    }
}